/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Gui;

import javax.swing.JOptionPane;

/**
 *
 * @author Monique
 */
public class FrmPdv extends javax.swing.JFrame {

    /**
     * Creates new form FrmPdv
     */
    public FrmPdv() {
        super("Frmacia produtos de vendas");
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        lblCodigo = new javax.swing.JLabel();
        txtCodigoEAN = new javax.swing.JTextField();
        lblQuantidade = new javax.swing.JLabel();
        textQuantidade = new javax.swing.JFormattedTextField();
        lblDesconto = new javax.swing.JLabel();
        txtTotal = new javax.swing.JFormattedTextField();
        lblTotal = new javax.swing.JLabel();
        lblDinheiro = new javax.swing.JLabel();
        txtDinheiro = new javax.swing.JFormattedTextField();
        textDesconto = new javax.swing.JFormattedTextField();
        lblTroco = new javax.swing.JLabel();
        textTroco = new javax.swing.JFormattedTextField();
        lblPagamentos = new javax.swing.JLabel();
        CmbSelecionarPagamento = new javax.swing.JComboBox();
        lblTipo = new javax.swing.JLabel();
        CmbSelecionar = new javax.swing.JComboBox();
        jScrollPane1 = new javax.swing.JScrollPane();
        TblTabela = new javax.swing.JTable();
        btnConfirmar = new javax.swing.JButton();
        btnCancelar = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        jSeparator2 = new javax.swing.JSeparator();
        jSeparator3 = new javax.swing.JSeparator();
        jLabel2 = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        lblCodigo.setText("Código EAN:");
        getContentPane().add(lblCodigo, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 39, -1, -1));
        getContentPane().add(txtCodigoEAN, new org.netbeans.lib.awtextra.AbsoluteConstraints(80, 40, 171, -1));

        lblQuantidade.setText("Quantidade:");
        getContentPane().add(lblQuantidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 40, -1, -1));

        try {
            textQuantidade.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        getContentPane().add(textQuantidade, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 40, 73, -1));

        lblDesconto.setText("Desconto na Compra:");
        getContentPane().add(lblDesconto, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 243, -1, -1));

        try {
            txtTotal.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        getContentPane().add(txtTotal, new org.netbeans.lib.awtextra.AbsoluteConstraints(40, 200, 104, -1));

        lblTotal.setText("Total:");
        getContentPane().add(lblTotal, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 205, -1, -1));

        lblDinheiro.setText("Dinheiro Cliente:");
        getContentPane().add(lblDinheiro, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 240, -1, -1));

        try {
            txtDinheiro.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        getContentPane().add(txtDinheiro, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 240, 90, -1));

        try {
            textDesconto.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        getContentPane().add(textDesconto, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 240, 104, -1));

        lblTroco.setText("Troco R$:");
        getContentPane().add(lblTroco, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 281, -1, -1));

        try {
            textTroco.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.MaskFormatter("####")));
        } catch (java.text.ParseException ex) {
            ex.printStackTrace();
        }
        getContentPane().add(textTroco, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 280, 104, -1));

        lblPagamentos.setText("Formas de Pagamento:");
        getContentPane().add(lblPagamentos, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 200, -1, -1));

        CmbSelecionarPagamento.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "- - - - -", "Dinheiro", "Cheque", "Carnê", "Cartão", "Covênio" }));
        getContentPane().add(CmbSelecionarPagamento, new org.netbeans.lib.awtextra.AbsoluteConstraints(370, 200, -1, -1));

        lblTipo.setText("Tipo do Cartão:");
        getContentPane().add(lblTipo, new org.netbeans.lib.awtextra.AbsoluteConstraints(230, 280, -1, -1));

        CmbSelecionar.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "- - - - -", "Visa", "MasterCard", "HiperCard", "BaneseCard" }));
        getContentPane().add(CmbSelecionar, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 280, -1, -1));

        TblTabela.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Descrição", "Preço unitário", "Quantidade", "Total"
            }
        ));
        jScrollPane1.setViewportView(TblTabela);

        getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(20, 80, 510, 92));

        btnConfirmar.setIcon(new javax.swing.ImageIcon("C:\\Users\\Monique\\Desktop\\7484_16x16.png")); // NOI18N
        btnConfirmar.setText("Confirmar");
        btnConfirmar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnConfirmarActionPerformed(evt);
            }
        });
        getContentPane().add(btnConfirmar, new org.netbeans.lib.awtextra.AbsoluteConstraints(180, 360, -1, -1));

        btnCancelar.setIcon(new javax.swing.ImageIcon("C:\\Users\\Monique\\Desktop\\8482_16x16.png")); // NOI18N
        btnCancelar.setText("Cancelar");
        btnCancelar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCancelarActionPerformed(evt);
            }
        });
        getContentPane().add(btnCancelar, new org.netbeans.lib.awtextra.AbsoluteConstraints(310, 360, -1, -1));
        getContentPane().add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 340, 550, 10));
        getContentPane().add(jSeparator2, new org.netbeans.lib.awtextra.AbsoluteConstraints(-10, 180, 560, 10));
        getContentPane().add(jSeparator3, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 70, 550, 30));

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Gui/painel2.jpg"))); // NOI18N
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 550, 410));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCancelarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCancelarActionPerformed
        // TODO add your handling code here:
        this.dispose();
    }//GEN-LAST:event_btnCancelarActionPerformed

    private void btnConfirmarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnConfirmarActionPerformed
        // TODO add your handling code here:
         JOptionPane.showMessageDialog(null, "Venda Realizada Com Sucesso !");
    }//GEN-LAST:event_btnConfirmarActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FrmPdv.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FrmPdv.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FrmPdv.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FrmPdv.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FrmPdv().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox CmbSelecionar;
    private javax.swing.JComboBox CmbSelecionarPagamento;
    private javax.swing.JTable TblTabela;
    private javax.swing.JButton btnCancelar;
    private javax.swing.JButton btnConfirmar;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JLabel lblCodigo;
    private javax.swing.JLabel lblDesconto;
    private javax.swing.JLabel lblDinheiro;
    private javax.swing.JLabel lblPagamentos;
    private javax.swing.JLabel lblQuantidade;
    private javax.swing.JLabel lblTipo;
    private javax.swing.JLabel lblTotal;
    private javax.swing.JLabel lblTroco;
    private javax.swing.JFormattedTextField textDesconto;
    private javax.swing.JFormattedTextField textQuantidade;
    private javax.swing.JFormattedTextField textTroco;
    private javax.swing.JTextField txtCodigoEAN;
    private javax.swing.JFormattedTextField txtDinheiro;
    private javax.swing.JFormattedTextField txtTotal;
    // End of variables declaration//GEN-END:variables
}
